from ChatGLM_new import zhipu_llm
from langchain_core.messages import AIMessage, HumanMessage, SystemMessage
from transformers import pipeline
import time
from langchain.prompts import PromptTemplate
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler

llm = zhipu_llm 
llm.temperature=0.1
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
prompt = ChatPromptTemplate.from_template("{topic}")
parser = StrOutputParser()
chain = prompt | llm | parser
print(chain.invoke({"topic": "红楼梦讲了什么"}))



